package com.example.dllo.moondog.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Toast;

import com.example.dllo.moondog.R;

/**
 * Created by Administrator on 2016/3/1.
 */
public class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //将Activity添加到基类中
        BaseApplication.addActivity(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //销毁集合中的Activity
        BaseApplication.removeActivity(this);
    }

    public void showToast(String string){
        Toast.makeText(BaseActivity.this, string, Toast.LENGTH_SHORT).show();
    }

    public void showLog(String d,String s){
        Log.d(d,s);
    }
}
